#include <iostream>
#include <thread>
using namespace std;

class TA
{
    public:
        /*
    int &m_i;//共引用变量m_i;
    TA(int &i) :m_i(i) 
    {
            cout<< "构造函数执行"<< endl;
    }
    TA(const TA &ta) :m_i(ta.m_i)
    {
        cout<< "拷贝构造函数"<< endl;
    }
    */
    void operater()()
    {
        cout<< "线程运行"<< endl;

        cout<< "线程结束"<< endl;
    }
   /* 
    ~TA()
    {
        cout<< "TA类析构"<< endl;
    }
    */
};
int main()
{
    int a=123;

    TA ta;//必须为正式对象不能为临时对象

    thread mytobj(ta);
    
    mytobj.join();

    cout<< "1主线程:" << endl;
    cout<< "2主线程:" << endl;
    cout<< "3主线程:" << endl;
    return 0;
}
